package 作业._p114实训1三;

import java.util.Scanner;

public class Rectangle extends Shape {
    double a,b;
    public Rectangle() {
    }
    public Rectangle(String name) {
        super(name);
    }
    public void input(){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入矩形的长和宽：");
        a = sc.nextDouble();b = sc.nextDouble();
    }

    @Override
    public void Area() {
        input();
        double S = a*b;
        System.out.println("矩形的面积为："+S);
    }
}
